package org.argeproje.resim.property;

import java.lang.reflect.*;

import org.eclipse.ui.views.properties.IPropertyDescriptor;

public abstract class Property{
    
	protected Method _getterMethod;
	protected Method _setterMethod;
	protected String _getterName;
	protected String _setterName;
	protected Object _owner;
	
	protected String _id;
	protected String _displayName;
	
	public Property(Object owner,String propertyId,String displayName,String getterMethodName,String setterMethodName)
	{
	   _owner       = owner;
	   _id           = propertyId;
	   _displayName  = displayName;	
	   _getterName = getterMethodName;
	   _setterName = setterMethodName;
	   try {
		_getterMethod = _owner.getClass().getMethod(_getterName);
		} catch (SecurityException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		} catch (NoSuchMethodException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
		}		
	}
	public String getId(){
		return _id;
	}
	public abstract void setValue(Object value);
	public abstract Object getValue();
	public abstract IPropertyDescriptor getDescriptor();
}
